package com.cipe.cmrs.controllers.reports;

import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import com.cipe.cmrs.model.Cipeproject;
import com.cipe.cmrs.service.CipeprojectService;

/**
 * This class is used for getting the list of projects for view page
 * 
 * @author Ashis Chettri
 * 
 */
@Controller
@RequestMapping("/secure/showLookupIndividualForm.do")
public class LookupIndividualReportController {

	@Autowired
	private CipeprojectService cipeService;
	protected static final String COMMAND_NAME = "cipeproject";
	private static final String FORM_VIEW = "reportForms/lookupIndividualReportForm";

	@RequestMapping(method = RequestMethod.GET)
	protected ModelAndView getFormView(
			@ModelAttribute(COMMAND_NAME) Cipeproject command,
			HttpServletRequest request) {
		ModelAndView model = new ModelAndView(FORM_VIEW);
		model.addObject("cipeProjectList", cipeService.findAll());
		return model.addAllObjects(getReferenceData(command, request));
	}

	protected Map<String, Object> getReferenceData(Cipeproject command,
			HttpServletRequest request) {
		Map<String, Object> map = new HashMap<String, Object>();
		return new HashMap<String, Object>();
	}
}
